﻿<%@ Page Title="Tìm kiếm tin tức" Language="vb" AutoEventWireup="false" MasterPageFile="~/Master/OutSite.Master" CodeBehind="SearchNew.aspx.vb" Inherits="Core.SearchNew" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script language="javascript">
    function CheckSubmit() {
        var data;
        //data = $('#ctl00_ContentPlaceHolder1_txtSearch').val();  //. DEV envi
        data = $('#ContentPlaceHolder1_txtSearch').val();  //. PRO envi
        if (data == "" || data == 'Nhập nội dung cần tìm') {
            $().toastmessage('showErrorToast', 'Bạn phải nhập nội dung cần tìm kiếm...');
            return false;
        } else {
            window.location = '/SearchNew.aspx?s=' + data + '&p=1';
        }
    }
    function KeyCodePage(e) {
        if (e) { e = e } else { e = window.event }
        if (e.which) { var keycode = e.which } else { var keycode = e.keyCode }
        //alert(keycode);
        if (keycode == 13) { CheckSubmit(); }
    }
</script>
<div class="boxPro">
	<div class="boxNew_header" style="padding-bottom:0px;float: left;width: 100%;"><a href="/SearchProduct.aspx" class="searchInActive">Tìm kiếm sản phẩm</a><span class="searchActive">Tìm kiếm tin tức</span></div>
    <div class="searchTitle">
        <asp:TextBox ID="txtSearch" runat="server" CssClass="txtSearch" Text="Nhập nội dung cần tìm"></asp:TextBox>
        <input type="button" value="Tìm kiếm" onclick="return CheckSubmit();" class="btnInput submitType">
    </div>
    <!-- List News -->
    <asp:Repeater ID="RepeatItems" runat="server">
        <HeaderTemplate>
            <ul class="New_ul">
        </HeaderTemplate>
        <ItemTemplate>
                <li>
			        <div class="newImg">
				        <a href='<%#buildLinkDetailPro(Eval("cateURI"), Eval("itemURI"), Eval("NewID"))%>' title='<%# Eval("NewTitle") %>'><img src='<%#buildImage(Eval("NewDate"), Eval("NewImage2"))%>' alt="'<%# Eval("NewTitle") %>'"></a>
			        </div>
			        <a class="newTitle" href='<%#buildLinkDetailPro(Eval("cateURI"), Eval("itemURI"), Eval("NewID"))%>'><%# Eval("NewTitle") %></a>
			        <p class="pDateTime"><span class="timeListHome"><label><%# buildTime(Eval("NewDate"), "hh:mm")%></label>  |  <%# buildDate(Eval("NewDate"), "DD-MM-YYYY")%></span></p>
			        <p class="newDesc"><%# getDesc(Eval("NewDesc"))%></p>
		        </li>
        </ItemTemplate>
        <FooterTemplate>
                </ul>         
        </FooterTemplate>
    </asp:Repeater>
    <!-- Navigator -->
    <div class="wrapNavigator" id="divNavigator" runat="server">
	</div>
</div>
</asp:Content>
